<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script type="text/javascript" src="${staticServer}/common/js/const.js"></script>
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>

<script>
var contextPath='${contextPath}';
$(function(){
$( "#btnSubmit" ).click( function(e){
		saveQuestion();
	});
	
	$("#cs_center").val('${practice.cs_center}');
	$("#region").val('${practice.center}');
})

saveQuestion = function() {
	var practiceId = $("#practiceId").val();
	var stu_id = $("#stu_id").val();
	var stu_name = $("#nickname").val()
	var tea_id = $("#tea_id").val();
	var course_type = $("#course_type").val();
	var student_msg = $("#student_msg").val();
	var stime = $("#stime").val();
	var center = $("#region").val();
	var to_name = $("#to_name").val();	
	var cs_center = $("#cs_center").val();
	var stattime = $("#stattime").val();		
	var shi1 = $("#shi1").val();
	var fen1 = $("#fen1").val();		
	var miao1 = $("#miao1").val();
	var phone = $("#phone").val();
	var member = $("#member").val();		
	var stat ="";
	
	
	if (stu_name == '') {
		infopad.err("学员姓名不能为空");
		return;
	}
	if (course_type == '') {
		infopad.err("请填写训练类型");
		return;
	}
	if (student_msg == '') {
		infopad.err("学员情况不能为空");
		return;
	}
	if (stime == '') {
		infopad.err("方案使用时间不能为空");
		return;
	}
	if(cs_center == ''){
		infopad.err("测试中心不能为空");
		return;
	}
	if(stattime == '' || shi1 == '' || fen1 == '' || miao1 == ''){
		infopad.err("开始时间不能为空");
		return;
	}else{
		stat = stattime+" "+shi1+"."+fen1+"."+miao1
	}
	
	$.post(contextPath+"/index/add_apply.json", {
		"id":practiceId,
		"stu_id" : stu_id,
		"stu_name" : stu_name,
		"tea_id" : tea_id,
		"course_type" : course_type,
		"student_msg":student_msg,
		"stime" : stime,
		"phone":phone,
		"member":member,
		"center" : center,
		"stat": stat,
		"cs_center":cs_center,
		"to_name":to_name,

	}, function(ms) {
		infopad.msg("申请成功");
		setTimeout(function(){
			window.location.href = contextPath+"/index/plan_apply.htm";
		},1000);

	});

};
</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>组织架构</li>
			<li>&gt;</li>
			<li class="current">title</li>
		</ul>
	</div>
	
	<input type="hidden" id="stu_id" value="${practice.stu_id}" >
	<input type="hidden" id="tea_id" value="${practice.tea_id}">
	<input type="hidden" id="practiceId" value="${practice.id}">
	<input type="hidden" id="to_name" value="${practice.to_name}">
	
	<div id="container">
		<div id="title">title</div>
	<table id="infotable">
			<tr class="fields">
				<th colspan="2">填写方案<a id="btn_detailed"></a></th>
			</tr>
			<tr>
				<th width="25%">选择学员
				</th>
				<td width="75%"><input id="nickname" value="${practice.stu_name}"/></td>
			</tr>
			
			<tr>
				<th width="25%">选择训练中心</th>
					<td width="75%">
					<select id="region">
						<option value="">--请选择训练中心--</option>
                		<#if office_List??>
                			<#list office_List as list>
                				<option value="${list.name}">${list.name}</option>
                			</#list>
                		</#if>
                	</select>
				</td>
			</tr>
			
			<tr>
				<th width="25%">测评中心
				</th>
				<td width="75%">
					<select id="cs_center">
						<option value="">--请选择训练中心--</option>
                		<#if office_List??>
                			<#list office_List as list>
                				<option value="${list.name}">${list.name}</option>
                			</#list>
                		</#if>
                	</select>
				</td>
				</tr>
				<tr>
					<th class="zt_widthlabel" width="25%">测评日期</th>
					<td colspan="2" width="75%">
					<input type="text" name="stime" id="stime" maxlength="15" size="19" value="" rel="DATE::Y-m-d" />  
					</td>
				</tr>
				<tr>
					<th class="zt_widthlabel" width="25%">训练课时</th>
					<td colspan="2" width="75%">
					<input type="text" name="course_type" id="course_type" value="${practice.course_type}" />  
					</td>
				</tr>
				
				<tr>
					<th class="zt_widthlabel" width="25%">电话号码</th>
					<td colspan="2" width="75%">
					<input type="text" name="phone" id="phone" value="${practice.phone}" />  
					</td>
				</tr>
				
				<tr>
					<th class="zt_widthlabel" width="25%">会员号</th>
					<td colspan="2" width="75%">
					<input type="text" name="member" id="member" value="${practice.loginName}"/>  
					</td>
				</tr>
					
				<tr>
					<th class="zt_widthlabel" width="25%">学员情况</th>
					<td colspan="2" width="75%">
						<textarea style="width:400px;height:150px;" type="text" id="student_msg" class="input w300" >${practice.student_msg}</textarea>
					</td>
				</tr>
			
				<tr>
					<th class="zt_widthlabel" width="25%">开始时间</th>
					<td colspan="2" width="75%">
					<input type="text" name="stattime" id="stattime" maxlength="15" size="15" value=""  rel="DATE::Y-m-d">
                	<select id="shi1">
							<option value="">时</option>
							<option value="01">01</option>
							<option value="02">02</option>
							<option value="03">03</option>
							<option value="04">04</option>
							<option value="05">05</option>
							<option value="06">06</option>
							<option value="07">07</option>
							<option value="08">08</option>
							<option value="09">09</option>
  							<option value="10">10</option>
  							<option value="11">11</option>
  							<option value="12">12</option>
  							<option value="13">13</option>
  							<option value="14">14</option>
  							<option value="15">15</option>
  							<option value="16">16</option>
  							<option value="17">17</option>
  							<option value="18">18</option>
  							<option value="19">19</option>
  							<option value="20">20</option>
  							<option value="21">21</option>
  							<option value="22">22</option>
  							<option value="23">23</option>
  							<option value="00">00</option>
					</select>
                	<select id="fen1">
							<option value="">分</option>
							<option value="00">00</option>
							<option value="01">01</option>
							<option value="02">02</option>
							<option value="03">03</option>
							<option value="04">04</option>
							<option value="05">05</option>
							<option value="06">06</option>
							<option value="07">07</option>
							<option value="08">08</option>
							<option value="09">09</option>
  							<option value="10">10</option>
  							<option value="11">11</option>
  							<option value="12">12</option>
  							<option value="13">13</option>
  							<option value="14">14</option>
  							<option value="15">15</option>
  							<option value="16">16</option>
  							<option value="17">17</option>
  							<option value="18">18</option>
  							<option value="19">19</option>
  							<option value="20">20</option>
  							<option value="21">21</option>
  							<option value="22">22</option>
  							<option value="23">23</option>
  							<option value="24">24</option>
  							<option value="25">25</option>
  							<option value="26">26</option>
  							<option value="27">27</option>
  							<option value="28">28</option>
  							<option value="29">29</option>
  							<option value="30">30</option>
  							<option value="31">31</option>
  							<option value="32">32</option>
  							<option value="33">33</option>
  							<option value="34">34</option>
  							<option value="35">35</option>
  							<option value="36">36</option>
  							<option value="37">37</option>
  							<option value="38">38</option>
  							<option value="39">39</option>
  							<option value="40">40</option>
  							<option value="41">41</option>
  							<option value="42">42</option>
  							<option value="43">43</option>
  							<option value="44">44</option>
  							<option value="45">45</option>
  							<option value="46">46</option>
  							<option value="47">47</option>
  							<option value="48">48</option>
  							<option value="49">49</option>
  							<option value="50">50</option>
  							<option value="51">51</option>
  							<option value="52">52</option>
  							<option value="53">53</option>
  							<option value="54">54</option>
  							<option value="55">55</option>
  							<option value="56">56</option>
  							<option value="57">57</option>
  							<option value="58">58</option>
  							<option value="59">59</option>
					</select>
                	<select id="miao1">
                			<option value="">秒</option>
                			<option value="00">00</option>
							<option value="01">01</option>
							<option value="02">02</option>
							<option value="03">03</option>
							<option value="04">04</option>
							<option value="05">05</option>
							<option value="06">06</option>
							<option value="07">07</option>
							<option value="08">08</option>
							<option value="09">09</option>
  							<option value="10">10</option>
  							<option value="11">11</option>
  							<option value="12">12</option>
  							<option value="13">13</option>
  							<option value="14">14</option>
  							<option value="15">15</option>
  							<option value="16">16</option>
  							<option value="17">17</option>
  							<option value="18">18</option>
  							<option value="19">19</option>
  							<option value="20">20</option>
  							<option value="21">21</option>
  							<option value="22">22</option>
  							<option value="23">23</option>
  							<option value="24">24</option>
  							<option value="25">25</option>
  							<option value="26">26</option>
  							<option value="27">27</option>
  							<option value="28">28</option>
  							<option value="29">29</option>
  							<option value="30">30</option>
  							<option value="31">31</option>
  							<option value="32">32</option>
  							<option value="33">33</option>
  							<option value="34">34</option>
  							<option value="35">35</option>
  							<option value="36">36</option>
  							<option value="37">37</option>
  							<option value="38">38</option>
  							<option value="39">39</option>
  							<option value="40">40</option>
  							<option value="41">41</option>
  							<option value="42">42</option>
  							<option value="43">43</option>
  							<option value="44">44</option>
  							<option value="45">45</option>
  							<option value="46">46</option>
  							<option value="47">47</option>
  							<option value="48">48</option>
  							<option value="49">49</option>
  							<option value="50">50</option>
  							<option value="51">51</option>
  							<option value="52">52</option>
  							<option value="53">53</option>
  							<option value="54">54</option>
  							<option value="55">55</option>
  							<option value="56">56</option>
  							<option value="57">57</option>
  							<option value="58">58</option>
  							<option value="59">59</option>
					</select>
					</td>
				</tr>
		</table>
		
		<div id="controlbar" style="width: 49%;">
			<input  id="btnSubmit" type="button" class="submit" value=" 保存方案  " /> 
		</div>
	</div>
	<div class="emptyline"></div>
</body>
</html>